package b.u.a;

import android.graphics.Rect;
import android.view.View;
import androidx.viewpager.widget.ViewPager;
import b.i.k.k;
import b.i.k.o;
import b.i.k.x;

/* compiled from: ViewPager */
public class b implements k {
    public final Rect a = new Rect();
    public final /* synthetic */ ViewPager b;

    public b(ViewPager viewPager) {
        this.b = viewPager;
    }

    public x a(View view, x xVar) {
        x l = o.l(view, xVar);
        if (l.g()) {
            return l;
        }
        Rect rect = this.a;
        rect.left = l.b();
        rect.top = l.d();
        rect.right = l.c();
        rect.bottom = l.a();
        int childCount = this.b.getChildCount();
        for (int i = 0; i < childCount; i++) {
            x d = o.d(this.b.getChildAt(i), l);
            rect.left = Math.min(d.b(), rect.left);
            rect.top = Math.min(d.d(), rect.top);
            rect.right = Math.min(d.c(), rect.right);
            rect.bottom = Math.min(d.a(), rect.bottom);
        }
        return l.h(rect.left, rect.top, rect.right, rect.bottom);
    }
}
